package at.fhooe.mc.master.clc.client;

import at.fhooe.mc.master.clc.client.handler.PresenterHandler;
import at.fhooe.mc.master.clc.client.presenter.AbstractGraphPresenter;
import at.fhooe.mc.master.clc.client.presenter.MetricsRequestPresenter;
import at.fhooe.mc.master.clc.client.presenter.MetricsVisualizationPresenter;
import at.fhooe.mc.master.clc.client.presenter.RootTemplatePresenter;

import com.google.gwt.user.client.ui.IsWidget;
import com.mvp4g.client.annotation.Event;
import com.mvp4g.client.annotation.Events;
import com.mvp4g.client.annotation.Start;
import com.mvp4g.client.event.EventBus;

@Events(startPresenter = RootTemplatePresenter.class)
public interface MetricsVisualizationEventBus extends EventBus
{
	@Event(handlers = RootTemplatePresenter.class)
	public void addRootTab(IsWidget widget, String title);
	
	@Event(handlers = MetricsVisualizationPresenter.class)
	public void setMetricsRequestWidget(IsWidget widget);
	
	@Event(handlers = PresenterHandler.class)
	public void createGraph(
			Class<? extends AbstractGraphPresenter<?, ?>> graphClass,
					String jsonData,
					String axisTitle,
					String graphTitle);
	
	@Event(handlers = MetricsVisualizationPresenter.class)
	public void addGraph(IsWidget widget, int key);
	
	@Event(handlers = MetricsVisualizationPresenter.class)
	public void removeGraph(IsWidget widget, int key);
	
	@Start
	@Event(handlers = {
			MetricsVisualizationPresenter.class,
			MetricsRequestPresenter.class,
			})
	public void start();
}
